function is continuous and differentiable